package com.zcx.app;

import android.text.TextUtils;

import com.zcx.bean.TokenBean;
import com.zcx.net.PreferencesHelper;

import java.util.Random;

/**
 * Created by hp on 2017/10/9.
 */

public class AppConfig {

    public static boolean isDotShow = false;
    private static final String SETTING = "SETTING";

    private static class Information {
        private static final String CONFIG = "CONFIG";
        private static final String USER_DATA = "USER_DATA";
        private static final String TOKEN_DATA = "TOKEN_DATA";
        private static final String USER_TYPE = "USER_TYPE";

        private static final String BACKGROUND_MUSIC = "BACKGROUND_MUSIC";
        private static final String SOUND = "SOUND";
        private static final String JARRING = "JARRING";
        private static final String LIVE = "LIVE";

        private static final String SEND_TIP = "SEND_TIP";
        private static final String PROBLEM = "PROBLEM";

        private static final String ADDRESS_CK = "CITY_NEW_CK";
        private static final String ADDRESS = "CITY";

        private static final String USE_WIFI = "USE_WIFI";
        private static final String GAME_WIFI = "GAME_WIFI";

        private static final String LAST_UPDATE = "LAST_UPDATE";
        private static final String UPDATE = "UPDATE";
        private static final String SHARE = "SHARE";

        private static final String NUMBER = "NUMBER";
        private static final String COUNT_DOWN = "COUNT_DOWN";
        private static final String IMEI = "IMEI";

        private static final String SIGN_IN = "SIGN_IN";

        private static final String MODULE_CK = "MODULE_CK";
        private static final String MODULE_DATA = "MODULE_DATA";
    }
        public static TokenBean getToken() {
            return (TokenBean) PreferencesHelper.getInstance(SETTING).getObject(Information.TOKEN_DATA);
        }
    public static String getImei() {
        String imei = PreferencesHelper.getInstance(SETTING).getString(Information.IMEI);
        if (TextUtils.isEmpty(imei)) {
            imei = String.valueOf(System.currentTimeMillis()) + String.valueOf(new Random().nextInt(10000));
            PreferencesHelper.getInstance(SETTING).putString(Information.IMEI, imei);
        }
        return imei;
    }
}
